from rest_framework.serializers import ModelSerializer

from approve.models import *




class StaffSerializer(ModelSerializer):
    class Meta:
        model = Staff
        fields = ['num','name','age','phone','sex']

class ApproveSerializer(ModelSerializer):
    staff = StaffSerializer(many=False)
    class Meta:
        model = Approve
        fields = '__all__'


class ApproveFlowSerializer(ModelSerializer):
    appr = ApproveSerializer(many=False)
    staff = StaffSerializer(many=False)
    class Meta:
        model = ApprFlow
        fields = '__all__'

class ApproveHistorySerializer(ModelSerializer):
    class Meta:
        model = ApprHistory
        fields = '__all__'

class ApproveRankSerializer(ModelSerializer):
    class Meta:
        model = ApprRank
        fields = '__all__'
